//
//  ApplyQuoteControl.m
//  FreeTime
//
//  Created by  on 16/9/6.
//  Copyright © 2016年 SRDZ.com. All rights reserved.
//

#import "ApplyQuoteControl.h"
#import "Header.h"
@interface ApplyQuoteControl (){
    UIButton *imgBt;
    UITextField *contentTF;
}
@property (nonatomic, strong)UIView *headView;
@property (nonatomic, strong)UIImageView *imgIV;
@property (nonatomic, strong)NSMutableArray *btnArray;
@property (nonatomic, strong)NSMutableArray *imgArray;
@property(nonatomic,strong)UIWindow *overlayWindow;
@property (nonatomic, strong)UIImageView *imgV;
@property (nonatomic, strong)UIImageView *imgV2;
@end

@implementation ApplyQuoteControl

- (void)viewDidLoad {
    [super viewDidLoad];
    NSArray *titleArr = @[@"线上",@"线下"];
    NSArray *imgArr = @[@"skillNor",@"skillLi"];
    self.view.backgroundColor = [UIColor clearColor];
    _headView = [[UIView alloc] initWithFrame:CGRectMake(0,0,240, 240)];
    _headView.backgroundColor = [UIColor whiteColor];
    UIImageView *back = [ReduceCode creatImageVeiwWithFrame:_headView.bounds imageName:@"quoteBG" isCorner:NO];
    back.userInteractionEnabled = YES;
    [_headView addSubview:back];
    
    CGFloat w = [ToolUtil autoWidth:@"线上" width:0 height:0 num:14];
    for (int i=0; i<2; i++) {
        UILabel *titleL = [ReduceCode creatLabelWithFrame:CGRectMake(54+i*(w+5+10+61), 23, w, 14) title:titleArr[i] titleColor:[ImageUtil colorWithRgb:0xFFFFFF] font:14 textAlignment:NSTextAlignmentLeft];
        [_headView addSubview:titleL];
        
        imgBt = [UIButton buttonWithType:UIButtonTypeCustom];
        imgBt.frame = CGRectMake(54+i*(w+5+10+61), 23, w+15, 14);
        _imgIV = [ReduceCode creatImageVeiwWithFrame:CGRectMake(w+5, 2, 10, 10) imageName:imgArr[i] isCorner:NO];
        [imgBt addSubview:_imgIV];
        imgBt.tag = 10+i;
        [imgBt addTarget:self action:@selector(Click:) forControlEvents:UIControlEventTouchUpInside];
        [self.btnArray addObject:imgBt];
        [self.imgArray addObject:_imgIV];
        [_headView addSubview:imgBt];
    }
    
    [ToolUtil createLine:48 superView:_headView lift:17 width:_headView.frame.size.width-34 hight:1 color:[UIColor colorWithRed:245.0/255 green:118.0/255 blue:157.0/255 alpha:1]];
    
    NSArray *fontTitleArr = @[@"逛街",@"吃饭",@"看电影",@"游戏"];
    CGFloat y = [ToolUtil autoWidth:@"逛街" width:0 height:0 num:12];
    for (int j=0; j<4; j++) {
        UIButton *fontBt = [UIButton buttonWithType:UIButtonTypeCustom];
        fontBt.frame = CGRectMake(17+(y+27)*j, 63, y+27, 12);
        [_headView addSubview:fontBt];
        UILabel *fontL = [ReduceCode creatLabelWithFrame:fontBt.bounds title:fontTitleArr[j] titleColor:[ImageUtil colorWithRgb:0xFFFFFF] font:12 textAlignment:NSTextAlignmentCenter];
        [fontBt addSubview:fontL];
    }
    
    CGFloat z = [ToolUtil autoWidth:@"¥" width:0 height:0 num:20];
    UILabel *RMBlb = [ReduceCode creatLabelWithFrame:CGRectMake(30, 148, z, 20) title:@"¥" titleColor:[UIColor colorWithRed:252.0/255 green:90.0/255 blue:114.0/255 alpha:1] font:20 textAlignment:NSTextAlignmentLeft];
    [_headView addSubview:RMBlb];
    contentTF = [[UITextField alloc] initWithFrame:CGRectMake(z+45+10, 143, 142.5, 30)];
    contentTF.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
    contentTF.font = FONT(14);
    contentTF.delegate = self;
    contentTF.layer.borderWidth = 1.0f;
    contentTF.layer.cornerRadius = 3;
    contentTF.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 30)];
    contentTF.leftViewMode = UITextFieldViewModeAlways;
    contentTF.layer.borderColor = [UIColor colorWithRed:228.0/255 green:228.0/255 blue:228.0/255 alpha:1].CGColor;
    [_headView addSubview:contentTF];
    
    [ToolUtil createLine:_headView.frame.size.height-41 superView:_headView lift:17 width:_headView.frame.size.width-34 hight:1 color:[UIColor colorWithRed:228.0/255 green:228.0/255 blue:228.0/255 alpha:1]];
    [ToolUtil createVerticalLine:_headView.frame.size.height-30 superView:_headView lift:_headView.frame.size.width/2-0.5 height:20 color:[UIColor colorWithRed:228.0/255 green:228.0/255 blue:228.0/255 alpha:1]];
    
    UIButton *sureBt = [UIButton buttonWithType:UIButtonTypeCustom];
    sureBt.frame = CGRectMake(0, _headView.frame.size.height-40, _headView.frame.size.width/2-0.5, 40);
    CGFloat q = [ToolUtil autoWidth:@"确定" width:0 height:0 num:14];
    UILabel *sureL = [ReduceCode creatLabelWithFrame:CGRectMake(54, 13, q, 14) title:@"确定" titleColor:[UIColor colorWithRed:206.0/255 green:126.0/255 blue:141.0/255 alpha:1] font:14 textAlignment:NSTextAlignmentLeft];
    [sureBt addTarget:self action:@selector(sureBtClick) forControlEvents:UIControlEventTouchUpInside];
    [sureBt addSubview:sureL];
    [_headView addSubview:sureBt];
    
    UIButton *cancelBt = [UIButton buttonWithType:UIButtonTypeCustom];
    cancelBt.frame = CGRectMake(_headView.frame.size.width/2+0.5, _headView.frame.size.height-40, _headView.frame.size.width/2-0.5, 40);
    UILabel *cancelL = [ReduceCode creatLabelWithFrame:CGRectMake(_headView.frame.size.width/2-54-q, 13, q, 14) title:@"取消" titleColor:[UIColor colorWithRed:104.0/255 green:104.0/255 blue:104.0/255 alpha:1] font:14 textAlignment:NSTextAlignmentLeft];
    [cancelBt addTarget:self action:@selector(cancelBtClick) forControlEvents:UIControlEventTouchUpInside];
    [cancelBt addSubview:cancelL];
    [_headView addSubview:cancelBt];
    [self.view addSubview:_headView];
}
#pragma mark -- 响应事件 --
- (void)Click:(UIButton *)btn{

}
- (void)sureBtClick{
    
    
}
- (void)cancelBtClick{
    
}
@end
